package nc.ui.tc.Monthlyadjustment.schedule;

import nc.ui.pub.bill.BillCardPanel;
import nc.ui.pub.bill.BillItem;
import nc.ui.pub.bill.BillListPanel;

public class ShowItem {

	public static void showItem(BillCardPanel billCardPanel, String jobcode,
			String month) {
		// String[] items = new String[] { "summary", "contractno",
		// // "borrowdate",
		// "repaymentdate",
		// "yearinterestratio",
		// // "addcapitalmoney",
		// // "subcapitalmoney",
		// "loanbalances",
		// // "interest",
		// "capitalmoney",
		//
		// "earlyloanbalances",
		//
		// // "monthlyexplain"+month,
		// // "m"+month+"borrowdate",
		// // "m"+month+"repaymentdate",
		// // "m"+month+"addcapitalmoney",
		// // "m"+month+"subcapitalmoney",
		// // "m"+month+"interest"
		//				
		// //
		// // "m"+month+"loanbalances",
		// // "m"+month+"interest"
		// };
		//		
		// // BillItem[]
		// billItems=billListPanel.getHeadBillModel().getBodyItems();
		// // for (int i = 0; i < billItems.length; i++) {
		// // billListPanel.hideHeadTableCol(billItems[i].getKey());
		// // }

		for (int i = 1; i < 13; i++) {

			if (!"305030201".equals(jobcode)) {
				billCardPanel.getHeadItem("m" + i + "proxytaxrate").setShow(
						false);
				billCardPanel.getHeadItem("m" + i + "proxytaxrate")
						.getCaptionLabel().setText("");
				billCardPanel.getHeadItem("m" + i + "proxytaxrate")
						.getComponent().setVisible(false);
			} else if (!month.equals(i + "")) {
				billCardPanel.getHeadItem("m" + i + "proxytaxrate").setShow(
						false);
				billCardPanel.getHeadItem("m" + i + "proxytaxrate")
						.getCaptionLabel().setText("");
				billCardPanel.getHeadItem("m" + i + "proxytaxrate")
						.getComponent().setVisible(false);
			}

			if (month.equals(i + "")) {
				continue;
			}

			billCardPanel.getHeadItem("monthlyexplain" + i).setShow(false);
			billCardPanel.getHeadItem("monthlyexplain" + i).getCaptionLabel()
					.setText("");
			billCardPanel.getHeadItem("monthlyexplain" + i).getComponent()
					.setVisible(false);

			billCardPanel.getHeadItem("m" + i + "borrowdate").setShow(false);
			billCardPanel.getHeadItem("m" + i + "borrowdate").getCaptionLabel()
					.setText("");
			billCardPanel.getHeadItem("m" + i + "borrowdate").getComponent()
					.setVisible(false);

			billCardPanel.getHeadItem("m" + i + "repaymentdate").setShow(false);
			billCardPanel.getHeadItem("m" + i + "repaymentdate")
					.getCaptionLabel().setText("");
			billCardPanel.getHeadItem("m" + i + "repaymentdate").getComponent()
					.setVisible(false);

			billCardPanel.getHeadItem("m" + i + "addcapitalmoney").setShow(
					false);
			billCardPanel.getHeadItem("m" + i + "addcapitalmoney")
					.getCaptionLabel().setText("");
			billCardPanel.getHeadItem("m" + i + "addcapitalmoney")
					.getComponent().setVisible(false);

			billCardPanel.getHeadItem("m" + i + "subcapitalmoney").setShow(
					false);
			billCardPanel.getHeadItem("m" + i + "subcapitalmoney")
					.getCaptionLabel().setText("");
			billCardPanel.getHeadItem("m" + i + "subcapitalmoney")
					.getComponent().setVisible(false);

			billCardPanel.getHeadItem("m" + i + "interest").setShow(false);
			billCardPanel.getHeadItem("m" + i + "interest").getCaptionLabel()
					.setText("");
			billCardPanel.getHeadItem("m" + i + "interest").getComponent()
					.setVisible(false);

		}
	}

	public static void hiddenItem(BillCardPanel billCardPanel, String month,
			String jobcode) {
		for (int i = 1; i < 13; i++) {
				billCardPanel.getHeadItem("m" + i + "proxytaxrate").setShow(
						false);
				billCardPanel.getHeadItem("m" + i + "proxytaxrate")
						.getCaptionLabel().setText("");
				billCardPanel.getHeadItem("m" + i + "proxytaxrate")
						.getComponent().setVisible(false);

				billCardPanel.getHeadItem("m" + i + "proxytaxrate").setShow(
						false);
				billCardPanel.getHeadItem("m" + i + "proxytaxrate")
						.getCaptionLabel().setText("");
				billCardPanel.getHeadItem("m" + i + "proxytaxrate")
						.getComponent().setVisible(false);

			billCardPanel.getHeadItem("monthlyexplain" + i).setShow(false);
			billCardPanel.getHeadItem("monthlyexplain" + i).getCaptionLabel()
					.setText("");
			billCardPanel.getHeadItem("monthlyexplain" + i).getComponent()
					.setVisible(false);

			billCardPanel.getHeadItem("m" + i + "borrowdate").setShow(false);
			billCardPanel.getHeadItem("m" + i + "borrowdate").getCaptionLabel()
					.setText("");
			billCardPanel.getHeadItem("m" + i + "borrowdate").getComponent()
					.setVisible(false);

			billCardPanel.getHeadItem("m" + i + "repaymentdate").setShow(false);
			billCardPanel.getHeadItem("m" + i + "repaymentdate")
					.getCaptionLabel().setText("");
			billCardPanel.getHeadItem("m" + i + "repaymentdate").getComponent()
					.setVisible(false);

			billCardPanel.getHeadItem("m" + i + "addcapitalmoney").setShow(
					false);
			billCardPanel.getHeadItem("m" + i + "addcapitalmoney")
					.getCaptionLabel().setText("");
			billCardPanel.getHeadItem("m" + i + "addcapitalmoney")
					.getComponent().setVisible(false);

			billCardPanel.getHeadItem("m" + i + "subcapitalmoney").setShow(
					false);
			billCardPanel.getHeadItem("m" + i + "subcapitalmoney")
					.getCaptionLabel().setText("");
			billCardPanel.getHeadItem("m" + i + "subcapitalmoney")
					.getComponent().setVisible(false);

			billCardPanel.getHeadItem("m" + i + "interest").setShow(false);
			billCardPanel.getHeadItem("m" + i + "interest").getCaptionLabel()
					.setText("");
			billCardPanel.getHeadItem("m" + i + "interest").getComponent()
					.setVisible(false);

		}
	}
}
